﻿<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="true" CodeBehind="ProductListWC.ascx.cs" Inherits="MadeInPortugalWebApplication.WebControl.ProductListWC" %>

<section id="page">
<asp:UpdatePanel ID="ProductListUpdatePanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:HiddenField runat="server" ID="hfPageNumber" Value="1"/>
        <div>
       <%-- <ul id="listButtons">
                        <li class="active"><a class="bigIcons" href="#">Ver ícones grandes</a></li>
                        <li><a class="smallIcons" href="#">Ver ícones pequenos</a></li>
                        <li><a class="list" href="#">Ver lista</a></li>
                    </ul>--%>
            <asp:LinkButton OnCommand="ChangePage_Command" CommandName="goPage" runat="server"
                ID="previousPage" CssClass="previousPage">Página anterior</asp:LinkButton>
            <asp:Repeater runat="server" ID="itemList" OnItemCommand="RepeaterItem_Command"  >
                <HeaderTemplate>
                    <ul id="itemList" class="off">
                </HeaderTemplate>
                <ItemTemplate>
                    <li id='<%# DataBinder.Eval(Container.DataItem, "ID") %>' class="ui-state-default">
                        <h3>
                            <a href='DispProduct.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID") %>'>
                                <%# DataBinder.Eval(Container.DataItem, "ProductName")%></a>
                            <%--<asp:Repeater ID="itemTagList" runat="server" DataSource='<%# DataBinder.Eval(Container.DataItem,"ProductName") %>'
                                OnItemCommand="RepeaterChangeTag_Command">
                                <ItemTemplate>
                                    <asp:LinkButton CssClass="smallTag" ID="itemtag" runat="server" CommandName="setTag"
                                        CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID") %>' OnCommand="RepeaterChangeTag_Command">
                                    <span><%# DataBinder.Eval(Container.DataItem, "ProductName")%></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:Repeater>--%>
                            <div class="itemActions">
                                <asp:LinkButton Visible='<%# AllowDelete %>' CssClass="action delete" runat="server"
                                    ID="removeItem" Text="" CommandName="deleteItem" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID") %>' />
                                <asp:LinkButton Visible='<%# AllowEdit %>' CssClass="action edit" runat="server"
                                    ID="editItem" Text='<%# DataBinder.Eval(Container.DataItem, "ID") %>' CommandName="editItem" CommandArgument='AdminItem.aspx?Id=<%# DataBinder.Eval(Container.DataItem, "ID") %>' />
                               <%-- <a href='Item.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID") %>'
                            id="editItem" class="action edit">--%>
                                <%--<asp:Label Visible='<%# AllowMove %>' CssClass="action move" runat="server" ID="moveItem"
                                    Text="mover" />--%>
                                <asp:LinkButton Visible='<%# AllowFavourite %>' CssClass="action favorite" runat="server"
                                    ID="favouriteItem" Text="marcar como favorito" CommandName="favouriteItem" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID") %>' />
                            </div>
                        </h3>
                        <a href='DispProduct.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID") %>' target='<%# Target %>'
                            id="Itemlink" class="detail">
                            <%--<p>
                                <%# DataBinder.Eval(Container.DataItem, "ProductName")%></p>--%>
                        </a></li>
                </ItemTemplate>
                <FooterTemplate>
                    </ul>
                </FooterTemplate>
            </asp:Repeater>
            <asp:LinkButton OnCommand="ChangePage_Command" CommandName="goPage" runat="server"
                ID="nextPage" CssClass="nextPage">Página seguinte</asp:LinkButton>
        </div>
        <ul id="pagination">
            <asp:Repeater runat="server" ID="paginationList" OnItemCommand="RepeaterChangePage_Command">
                <HeaderTemplate>
                    <li>Página</li>
                </HeaderTemplate>
                <ItemTemplate>
                    <li class='<%# DataBinder.Eval(Container.DataItem, "Class") %>'>
                        <asp:LinkButton runat="server" ID="paginationItem" Text='<%# DataBinder.Eval(Container.DataItem, "PageNumber") %>'
                            CommandName="goPage" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "PageNumber") %>' />
                    </li>
                </ItemTemplate>
            </asp:Repeater>
        </ul>
        <input id="listSerialized" value="0" size="50" />
       <%-- <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="ProductListUpdatePanel"
            DynamicLayout="true">
            <ProgressTemplate>
                <div id="spinner">
                    <img alt="Loading" src="/images/ajax-loader-bar.gif" />
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>--%>
    </ContentTemplate>
</asp:UpdatePanel>

    <div id="dialog-confirm" title="Confirmação?">
        <p>
            Deseja eliminar este item?</p>
    </div>
</section>